package com.sense.kukoo.biz_messages.adapter.provider

import android.widget.TextView
import com.sense.kukoo.biz_messages.R
import com.sense.kukoo.biz_messages.adapter.MessagesItemAdapter
import com.sense.kukoo.common.repo.biz.MessagesItemBean
import com.sense.kukoo.common.utils.ApplicationContext
import com.sense.kukoo.common.wiget.adapter.provider.MultiItemProvider
import com.sense.kukoo.common.wiget.adapter.viewholder.BaseViewHolder

class EmptyMessagesItemProvider(
    val listener: MessagesItemAdapter.MessagesItemListener,
): MultiItemProvider<MessagesItemBean>() {

    override fun getItemType(): Int = MessagesItemBean.TYPE_EMPTY_LIST

    override fun getItemLayoutId(): Int = R.layout.biz_messages_item_empty_list

    override fun onBindViewHolder(viewHolder: BaseViewHolder, item: MessagesItemBean) {
        //
        val tv_title_empty_list = viewHolder.getView(R.id.tv_title_empty_list) as TextView
        val tv_title_sub_empty_list = viewHolder.getView(R.id.tv_title_sub_empty_list) as TextView
        //
        when (item.emptyType) {
            MessagesItemBean.TYPE_LIKES -> {
                tv_title_empty_list.text = ApplicationContext.getString(com.sense.kukoo.common_i18n.R.string.messages_item_empty_title_likes)
                tv_title_sub_empty_list.text = ApplicationContext.getString(com.sense.kukoo.common_i18n.R.string.messages_item_empty_sub_title_likes)
            }
            MessagesItemBean.TYPE_FOLLOWERS -> {
                tv_title_empty_list.text = ApplicationContext.getString(com.sense.kukoo.common_i18n.R.string.messages_item_empty_title_followers)
                tv_title_sub_empty_list.text = ApplicationContext.getString(com.sense.kukoo.common_i18n.R.string.messages_item_empty_sub_title_followers)
            }
            MessagesItemBean.TYPE_COMMENTS -> {
                tv_title_empty_list.text = ApplicationContext.getString(com.sense.kukoo.common_i18n.R.string.messages_item_empty_title_comments)
                tv_title_sub_empty_list.text = ApplicationContext.getString(com.sense.kukoo.common_i18n.R.string.messages_item_empty_sub_title_comments)
            }
        }
    }
}